package com.lvmama.controller.rhino.searchanalysis;

import com.github.pagehelper.PageInfo;
import com.lvmama.common.result.Result;
import com.lvmama.pojo.dto.rhino.searchanalysis.*;
import com.lvmama.pojo.entity.rhino.searchanalysis.FlowSearchStation;
import com.lvmama.service.rhino.searchanalysis.FlowSearchService;
import com.lvmama.service.rhino.topic.StatisticCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName : FlowSearchController
 * @Description :
 * @Author :Administrator
 * @Date : 2018/8/6 17:39
 * @Version V1.0
 **/

@RestController
@RequestMapping("/flowSearch")
public class FlowSearchController {

    @Autowired
    FlowSearchService flowSearchService;
    @Autowired
    StatisticCodeService statisticCodeService;

    @GetMapping(value = {"/getDeviceCodeApp"})
    public List<String> getDeviceCodeApp(){
        return statisticCodeService.getDeviceCodeApp();
    }

    @GetMapping(value = {"/getDeviceCodeByLikeName"})
    public List<String> getDeviceCodeByLikeName(@RequestParam("codeName") String codeName){
        return statisticCodeService.getDeviceCodeByLikeName(codeName);
    }

    @PostMapping("/getSearchFlowByChannel")
    public Result<List<FlowSearchStatistics>> getSearchFlowByChannel(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getSearchFlowByChannel(queryParam);
    }

    @PostMapping("/getSearchFlowByDate")
    public Result<List<FlowSearchStatistics>> getSearchFlowByDate(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getSearchFlowByDate(queryParam);
    }

    @PostMapping("/getStations")
    public Result<List<FlowSearchStation>> getStations(){
        return flowSearchService.getStations();
    }

    @PostMapping("/getKeyByType")
    public Result<List<FlowSearchKeyType>> getKeyByType(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByType(queryParam);
    }
    @PostMapping("/getKeyByDate")
    public Result<List<FlowSearchKeyType>> getKeyByDate(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByDate(queryParam);
    }
    @PostMapping("/getKeyByAmount")
    public Result<PageInfo<FlowSearchKey>> getKeyByAmount(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByAmount(queryParam);
    }
    @PostMapping("/getKeyByCategory")
    Result<List<FlowSearchArrivalKey>> getKeyByCategory(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByCategory(queryParam);
    };

    @PostMapping("/getKeyByKeyword")
    public Result<List<FlowSearchArrivalKey>> getKeyByKeyword(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByKeyword(queryParam);
    }
    @PostMapping("/getKeyByXgword")
    public Result<List<FlowSearchArrivalKey>> getKeyByXgword(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getKeyByXgword(queryParam);
    };

    @PostMapping("/getDetailByStation")
    public Result<List<FlowSearchKey>>  getDetailByStation(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getDetailByStation(queryParam);
    }

    @PostMapping("/getDetailByType")
    public Result<List<FlowSearchKey>>  getDetailByType(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getDetailByType(queryParam);
    }

    @PostMapping("/getPagingByCategory")
    public  Result<List<FlowSearchPaging>> getPagingByCategory(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getPagingByCategory(queryParam);
    }
    @PostMapping("/getPagingByPageCode")
    public Result<List<FlowSearchPaging>> getPagingByPageCode(@RequestBody SearchStatisticsQuery queryParam){
        return  flowSearchService.getPagingByPageCode(queryParam);
    }
    @PostMapping("/getSwitchByCategory")
    public Result<List<FlowSearchJump>> getSwitchByCategory(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getSwitchByCategory(queryParam);
    }
    @PostMapping("/getSwitchByDate")
    public Result<List<FlowSearchJump>> getSwitchByDate(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getSwitchByDate(queryParam);
    }
    @PostMapping("/getJumpByCategory")
    Result<List<FlowSearchJump>> getJumpByCategory(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getJumpByCategory(queryParam);
    }
    @PostMapping("/getJumpByDate")
    Result<List<FlowSearchJump>> getJumpByDate(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getJumpByDate(queryParam);
    }

    @PostMapping("/getSwitchByResult")
    Result<List<FlowSearchJump>> getSwitchByResult(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getSwitchByResult(queryParam);
    }
    @PostMapping("/getMoJumpByResult")
    Result<List<FlowSearchJump>> getMoJumpByResult(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getMoJumpByResult(queryParam);
    }

    @PostMapping("/getResultByCategory")
    Result<List<FlowSearchResult>> getResultByCategory(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getResultByCategory(queryParam);
    }

    @PostMapping("/getResultByDate")
    Result<List<FlowSearchResult>> getResultByDate(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getResultByDate(queryParam);
    }

    @PostMapping("/getResultByKey")
    Result<PageInfo<FlowSearchResult>> getResultByKey(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getResultByKey(queryParam);
    }
    @PostMapping("/getFilterList")
    Result<List<FlowSearchFilter>> getFilterList(@RequestBody SearchStatisticsQuery queryParam){
        return flowSearchService.getFilterList(queryParam);
    }

    @PostMapping("/getFilterNameByCode")
    Result<FlowSearchFilterCondition> getFilterNameByCode(@RequestBody FlowSearchFilterCondition queryParam){
        return flowSearchService.getFilterNameByCode(queryParam);
    }
    @PostMapping("/insertFilter")
    boolean insertFilter(@RequestBody FlowSearchFilterCondition queryParam){
        return flowSearchService.insertFilter(queryParam);
    }

}
